home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / RMI_OS / RMI-PREB / EXAMPLES / HELLO / RUN.BAT < prev    next >
Encoding:
DOS Batch File  |  1996-11-04  |  2.4 KB  |  89 lines

  1. @echo off
  2. set TOPDIR=..\..
  3.  
  4. rem  This BAT script explains and carries out the process of compiling
  5. rem  and running the hello example.  The important commands are
  6. rem  summarized here:
  7. rem
  8. rem    rmiregistry
  9. rem    javac -d ..\.. *.java
  10. rem    rmic -d ..\.. examples.hello.HelloImpl
  11. rem    java -Djava.rmi.server.codebase="your_url" examples.hello.HelloImpl
  12. rem    appletviewer index.html
  13. rem     
  14. rem  NOTE: The "call" command is used below to execute other BAT scripts
  15. rem  (rmic and rmiregistry) so that they return to this script upon
  16. rem  completion.  The "call" is not be necessary when these commands
  17. rem  are executed directly from the command prompt.
  18.  
  19. echo ************************************************************************
  20. echo *
  21. echo * This script goes through the complete process of compiling and
  22. echo * running the hello example on your local machine.
  23.  
  24. echo *
  25. echo * First, start the RMI registry...
  26. echo *
  27. @echo on
  28. call rmiregistry
  29. @echo off
  30.  
  31. echo *
  32. echo * To compile and run server, temporarily add the root directory
  33. echo * of these classes (..\..) to CLASSPATH...
  34. echo *
  35. @echo on
  36. set ORIGCLASSPATH=%CLASSPATH%
  37. set CLASSPATH=%TOPDIR%;%CLASSPATH%
  38. @echo off
  39.  
  40. echo *
  41. echo * Compile all Java sources files...
  42. echo *
  43. @echo on
  44. javac -d %TOPDIR% *.java
  45. @echo off
  46.  
  47. echo *
  48. echo * Run rmic to generate stub and skeleton classes for HelloImpl...
  49. echo *
  50. @echo on
  51. call rmic -d %TOPDIR% examples.hello.HelloImpl
  52. @echo off
  53.  
  54. echo *
  55. echo * Start the server examples.hello.HelloImpl...
  56. echo *
  57. @echo on
  58. start java -Djava.rmi.server.codebase=file:/%RMIHOME%/ examples.hello.HelloImpl
  59. @echo off
  60.  
  61. echo *
  62. echo * Please wait until a message appears in the server process's window
  63. echo * indicating that it has been bound to the registry.
  64. echo *
  65. pause
  66.  
  67. echo *
  68. echo * Restore the original CLASSPATH at this point, so that the appletviewer
  69. echo * will not have any of these example classes locally available through
  70. echo * CLASSPATH.  Therefore, it must load them through the codebase...
  71. echo *
  72. @echo on
  73. set CLASSPATH=%ORIGCLASSPATH%
  74. @echo off
  75.  
  76. echo *
  77. echo * Start the appletviewer...
  78. echo *
  79. @echo on
  80. appletviewer index.html
  81. @echo off
  82.  
  83. echo *
  84. echo * If all the preceding steps were successful, the registry and server
  85. echo * processes are still running.  You can manually destroy these windows
  86. echo * to clean up before running this script again.
  87. echo *
  88.  
  89.